﻿@{
    Layout = null;
    ViewBag.Title = "订单确认";
    var list = ViewData["list"] as List<Pay.DTO.ordermodel>;
    var domain = ViewData["url"] as string;
    var likelist = ViewData["likelist"] as Pay.TO.PagedResult<Pay.DTO.product_dto>;
    var address = ViewData["address"] as Pay.DTO.shipping_dto;
    var order_no = ViewData["pay_no"] as string;
    var is_login = HttpContext.Current.User.Identity.IsAuthenticated;
    var go_url = is_login ? @"/User/SelectAdressList" : @"/User/AddAddress";
    bool is_seaover = (bool)ViewData["is_seaover"];
}
<html>

<head>
    <meta charset="UTF-8">
    <title>确认订单</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <meta name="format-detection" content="telphone=no, email=no" />
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <meta name="msapplication-tap-highlight" content="no">
    <link rel="stylesheet" type="text/css" href="~/Content/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="~/Content/css/gelunbu.css" />
</head>

<body style="background: #F0F0F0;">
    <div class="glb_wraper">
        <div class="firm">
            <div class="firm_top">
                @if (address == null) {
            <a href="/User/AddAddress" class="firm_create">
                <i class="icon_add_1"></i>创建新的收货地址
            </a>
                }
           else {
            <div class="consignee">
                <div class="consig_left"></div>
                <div class="consig_right">
                    <div class="consig_name">
                        <a href="@go_url" style="background: url(/Content/images/arrow_r@2x.png) right center no-repeat; background-size:5px 10px; display: block;width: 100%; color: #666;">  收货人：@address.ship_to @address.phone</a>
                    </div>
                    <p class="consig_rg_adress">地址：@(address.region_name + " " + address.address)</p>
                    <p class="sfz_Id">@address.id_card</p>
                </div>
                <div class="clear" style="clear: both;"></div>
                <div class="sfz_Img">
                    <img  src="@(string.IsNullOrEmpty(address.card_positive)?"/Content/images/dizhi_sfzzm@2x.png":site.img_url+address.card_positive)" class="sfz_img_list"/>
                    <img src="@(string.IsNullOrEmpty(address.card_negative)?"/Content/images/dizhi_sfzzm@2x.png": site.img_url+address.card_negative)" class="sfz_img_list" />
                </div>
                <div class="clear" style="clear: both;"></div>
            </div>
}
            <p class="firm_slogin">海外直邮商品需提供收货人身份证信息及身份证照片用于办理清关手续。</p>
            </div>
            @if (list != null && list.Count > 0) {
                foreach (var item in list) {
                    var src = domain + item.image;
                    <div class="order_detail" style="padding:0 10px;background: #fff; height: 120px; margin-top: 10px; ">
                        <img src="@src" alt="">
                        <section class="order_detil_box">
                            <h1 class="proTit">@item.name</h1>
                            <p></p>
                        </section>
                        <div class="order_price"><span>￥@item.price</span> <strong>x @item.quantity</strong></div>
                    </div>
                }
            }
            <ul class="od_item">
                <li>运费： <span class="od_price">@(string.Format("海外直邮：¥{0}",ViewData["freight"]))</span></li>
                <li>税费： <span class="od_price">@(string.Format("¥{0}",ViewData["tax"]))</span></li>
                <li class="od_border_top">订单总计： <span class="od_price">@(string.Format("¥{0}",ViewData["totalmoney"])) </span></li>
            </ul>
            <div class="payBox">
                <ul class="payUl">
						@if(is_seaover){
							<li style="border-bottom: none;">
		                        <i class="iconYl"></i>银联支付
		                        <div class="ck_box">
		                            <input type="checkbox" id="check" name="check_1" checked="checked"><label for="check_1"></label>
		                        </div>
		                    </li>
						}else{
							<li style="border-bottom: none;">
			                        <i class="iconYl"></i>微信支付
			                        <div class="ck_box">
			                            <input type="checkbox" id="check" name="check_1" checked="checked"><label for="check_1"></label>
			                        </div>
			                </li>
						}
                </ul>
            </div>
            <div class="payment">
                <div class="total_pay">
                    总计:<span class="total_num"> @(string.Format("¥{0}",ViewData["totalmoney"])) </span>
                </div>
                <input type="button" onclick="Pay()" value="去付款" class="gpay_btn" />
            </div>
        </div>
    </div>

    <script src="~/Content/js/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="~/Content/js/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="~/Content/js/web.js"></script>
    <script type="text/javascript">
        function Pay() {
			ajax({
					url:"/CheckOut/Pay",
					data:{ pay_no: '@order_no' },
	                actions:"system"
				});
        }

	  function testApp(url) { 
          var timeout, t = 1000, hasApp = true; 
          setTimeout(function () { 
            if (!hasApp) { 
                //没有安装微信
                var r=confirm("您没有安装微信，请先安装微信!");
                if (r==true){
                    location.href="http://weixin.qq.com/"
                }
            }else{
                //安装微信
				
            }
            document.body.removeChild(ifr); 
          }, 2000) 
          
          var t1 = Date.now(); 
          var ifr = document.createElement("iframe"); 
          ifr.setAttribute('src', url); 
          ifr.setAttribute('style', 'display:none'); 
          document.body.appendChild(ifr); 
          timeout = setTimeout(function () { 
             var t2 = Date.now(); 
             if (!t1 || t2 - t1 < t + 100) { 
               hasApp = false; 
             } 
          }, t); 
        } 
        //判断访问终端
        var browser={
            versions:function(){
                var u = navigator.userAgent, app = navigator.appVersion;
                return {
                    trident: u.indexOf('Trident') > -1, //IE内核
                    presto: u.indexOf('Presto') > -1, //opera内核
                    webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1,//火狐内核
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
                    iPhone: u.indexOf('iPhone') > -1 , //是否为iPhone或者QQHD浏览器
                    iPad: u.indexOf('iPad') > -1, //是否iPad
                    webApp: u.indexOf('Safari') == -1, //是否web应该程序，没有头部与底部
                    weixin: u.indexOf('MicroMessenger') > -1, //是否微信 （2015-01-22新增）
                    qq: u.match(/\sQQ/i) == " qq" //是否QQ
                };
            }(),
            language:(navigator.browserLanguage || navigator.language).toLowerCase()
        }
    </script>
</body>
</html>
